<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<?=$charset?>" />
<title><?=$title?></title>
<meta  name="keywords" content="<?=$keywords?> " />
<meta  name="description" content="<?=$description?>"/>	

<!-- CSS -->
<link href="/style/css/transdmin.css" rel="stylesheet" type="text/css" media="screen" />
<!--[if IE 6]><link rel="stylesheet" type="text/css" media="screen" href="/style/css/ie6.css" /><![endif]-->
<!--[if IE 7]><link rel="stylesheet" type="text/css" media="screen" href="/style/css/ie7.css" /><![endif]-->

<!-- JavaScripts-->
<script type="text/javascript" src="/style/js/jquery.js"></script>
<script type="text/javascript" src="/style/js/jNice.js"></script>
<script language="javascript" src="/js/prototype.js"></script>
<script language="javascript" src="/js/javafunc.js"></script>
<script language="javascript" src="/js/bash.js"></script>
<script language="javascript">
function go_search()
{
	if ((document.getElementById("server_id_key").value=="") || (document.getElementById("server_id_key").value=="请输入SERVER IP")) {
		alert("请输入SERVER IP。");
		document.getElementById("server_id_key").focus();
		clear_inputbox();
		return false;
	}
	
	window.location.href="/lvs/Servers?serverip="+document.getElementById("server_id_key").value+"&vipip=";
}

function clear_inputbox()
{
	if ((document.getElementById("server_id_key").value=="请输入SERVER IP") || (document.getElementById("server_id_key").value==""))
		document.getElementById('server_id_key').value='请输入SERVER IP';	
}

function  go_keydown(evt)  
{  
	evt=(evt)?evt:((window.event)?event:null);
	if (evt){
		if(evt.keyCode==13){
			return go_search();
		}
	} 
}
</script>
</head>

<body>
<div id="systemWorking" style="z-index:100; position:absolute;display:none;left:40%;top:40%"><table width="250" height="20" border="0" cellpadding="0" cellspacing="1" bgcolor="#6EB1F4"><tr><td bgcolor="#FFFFFF" align="center" valign="middle"><img src="/images/loading.gif" align=center>　　系统正在处理中...</td></tr></table></div>
	<div id="wrapper">
    	<h1><a href="#"><span>天翌LVS管理系统</span></a></h1>     
			<?
			  	include "lvsmenu_view.php";
			?>   
	</div>
    <!-- // #wrapper -->
<table height="510" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#EEEEEE" class="tables_main">
      <tr>
        <td height="193" align="center">
	<table width="20" border="0" cellpadding="00">
          <tr>
            <td height="4"></td>
          </tr>
        </table>
	<table height="490" border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
          <tr>
            <td width="80" height="60" valign="top">
			<?
			include "lvsfunmenu_view.php";
			?>
			</td>
            <td width="1" rowspan="2" align="center" valign="top" bgcolor="#eeeeee"></td>
            <td width="735" rowspan="2" align="center" valign="top">
			 <div align="left">
			   <table width="98%" height="31" border="0" cellpadding="00" cellspacing="1">
                 <tr>
                   <td width="2">&nbsp;</td>
                 <td width="240" valign="bottom"><a href="/lvs/">LVS管理</a> &raquo; <a href="/lvs/Servers" class="active">主机管理</a></td>
                 </tr>
                 <tr>
                   <td></td>
                   <td height="1" bgcolor="#EEEEEE"></td>
                 </tr>
               </table>
		<br />
	<div style="position:relative; height:445px; overflow-y:auto">
	<table width="96%"  border="0" align="center" cellpadding="0" cellspacing="0">
          <tr>
            <td>
		      <input name="server_id_key" id="server_id_key" type="text" size="15" onBlur="javascript:clear_inputbox()" onClick="javascript:document.getElementById('server_id_key').value='';" onkeydown="go_keydown(event);" value="<? if (!empty($serverip)) echo $serverip; else echo "请输入SERVER IP";?>">
		      &nbsp;<input type="button" class="button-css" name="search" value="<?=$this->lang->line('index_search')?>" style="cursor:hand" onClick="go_search();">
			</td>
          </tr>
	</table>
	<br>
<table width="98%" height="400" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td align="center" valign="top">
	<form name="f3" method="post">
        <table width="98%"  border="0" cellpadding="2" cellspacing="1" bgcolor="#CCCCCC">
          <tr align="center" bgcolor="#D5DEDB" height="34"" >
			<td height="20" bgcolor="#D5DEDB"><a href=javascript:un();>选择</a></td>
	    <td><strong>状态</strong></td>
	    <td><strong>VIP</strong></td>
            <td><strong>服务IP</strong></td>
            <td><strong>通讯IP</strong></td>
            <td><strong>主机名称</strong></td>
	    <td><strong>服务端口</strong></td>
            <td><strong>权重</strong></td>
            <td><strong>监控名称</strong></td>
	    <td><strong>操作</strong></td>
          </tr>
			<?php
			$i=1;
			$bgColor="#F9F9F9";
			foreach($results->result() as $myrow)
			{
				echo "<TR height=30 bgColor=".$bgColor." onmouseover=\"this.bgColor='#F0F7FA';this.color='#ffffff'\" onmouseout=\"this.bgColor='".$bgColor."';\">\n";
				echo "<td align=\"center\" width=\"50\"><input type=checkbox id=check_".$i." name=\"selected_id[]\" value=\"".$myrow->ID."\"></td>\n";
				echo "	<td align=\"center\">\n";
				if ($myrow->weight==0)
					echo "<img src='/images/status_circle_black.gif'>\n";
				else if ($myrow->weight!=0){
					echo "<img src='/images/status_circle_green.gif'>\n";
				}
				
				echo "</td>\n";
				echo "	<td align=\"center\"><font color=green><b>";
				echo $myrow->VIP;
				echo "</b></font></td>\n";
				echo "	<td align=\"center\"><a href=\"/lvs/Servers_do/".$myrow->ID."\">".$myrow->serverip."</a></td>\n";
				echo "	<td align=\"center\">".$myrow->serverlip."</td>\n";
				echo "	<td align=\"center\">".$myrow->servername."</td>\n";
				echo "	<td align=\"center\">".$myrow->port."</td>\n";
				echo "	<td align=\"center\">".$myrow->weight."</td>\n";
				echo "	<td align=\"center\">".$myrow->Monitors."</td>\n";
				echo "	<td align=\"center\"><a href=\"javascript:submitlvs('3','".$myrow->VIP."','".$myrow->serverip."','".$myrow->servername."')\"><img src=\"/images/onebit_08.gif\" title=\"设置LB\"></a>&nbsp;&nbsp;<a href=/lvs/Performance/server/null/".$myrow->serverip."><img src=\"/images/onebit_16.gif\" title=\"性能图表\"></a></td>\n";
				echo "</tr>\n";
				$i++;
				if ($bgColor=="#F9F9F9") {$bgColor="#ffffff";}else{$bgColor="#F9F9F9";}				
			}
		  ?>
        </table>
		<input name="per_page" type="hidden" value="<?=$per_page?>">
		<input name="auditing" type="hidden" value="1">
	 	</form><br>
		<table width="98%"  border="0" cellpadding="0" cellspacing="0">
          <tr>
            <td align="left">		
	<?
	if ($total_rows>0)
	{
		//echo "<a class=smalla href=\"javascript:all();\">[".$this->lang->line('admin_all')."]</a> ";
		//echo "<a class=smalla href=\"javascript:un();\">[".$this->lang->line('admin_un')."]</a> ";
		//echo "<a class=smalla href=\"javascript:del('/admin/FocusServer_do_del');\"><font color=#326565>［</font>".$this->lang->line('admin_delete')."<font color=#326565>］</font></a>\n";		
	}
	echo "<input type=\"button\" name=\"add\" value=\"增 加\" class=\"button-css\" onClick=\"javascript:window.location.href='/lvs/Servers_do';\">&nbsp;&nbsp;\n";
	echo "<input type=\"button\" name=\"edit\" value=\"修 改\" class=\"button-css\" onClick=\"javascript:edit('/lvs/Servers_do');\">&nbsp;&nbsp;\n";
	echo "<input type=\"button\" name=\"enable\" value=\"启 用\" class=\"button-css\" onClick=\"javascript:auditing('/lvs/Servers_do_Condition','3');\">&nbsp;&nbsp;\n";
	echo "<input type=\"button\" name=\"disable\" value=\"禁 用\" class=\"button-css\" onClick=\"javascript:auditing('/lvs/Servers_do_Condition','0');\">\n";

	?>
			</td>
          </tr>
        </table>	
        <br>
            <table width=98%>
		    <tr>
		      <td align="center">
		      <font class=normal><?php echo $this->pagination->create_links()."&nbsp;".$this->lang->line('index_totalrec')."[".$total_rows."]</font>"; ?>
			<div id="maindiv"></div>
		      </td>
		    </tr>
		  </table>
	</td>
  </tr>
</table>
	</div>
	<table width="20" border="0" cellpadding="00">
          <tr>
            <td height="4"></td>
          </tr>
        </table>
	</td>
      </tr>
    </table>
<br>
</body>
</html>